#include "c-utils/utils.h"
#include "c-utils/utils_log.h"
#include <unistd.h>
void timer_cb(void *p)
{
    int *v = (int *)p;
    *v = 2;
    log_info("p: %p, *p %d", p, *v);
}

int test_timer(int argc, char *argv[])
{
    int v = 0;
    utils_create_timer(TIMER_TYPE_REALTIME, &timer_cb, &v, 1, 0);
    int cnt = 0;
    while (v == 0)
    {
        usleep(100 * 1000);
        log_info("v: %p, v %d", &v, v);
        cnt++;
        if (cnt > 12)
            return -1;
    }
    return 0;
}